<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateCustomerDepartmentTaskTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('customer_department_task', function (Blueprint $table) {
            $table->id();
            $table->string('wgNumber', 12)->default('')->comment('网规编号');
            $table->unsignedTinyInteger('wgType')->default(0)->comment('网规类型');
            $table->string('wgName', 25)->default('')->comment('网规名称');
            $table->unsignedInteger('ranking')->default(0)->comment('商场排名');
            $table->unsignedInteger('assignId')->default(0)->comment('指派给');
            $table->unsignedInteger('assignTime')->default(0)->comment('指派时间');
            $table->unsignedInteger('manageStatus')->default(0)->comment('管理状态');
            $table->unsignedInteger('projectPhase')->default(0)->comment('项目阶段');
            $table->unsignedTinyInteger('grade')->default(0)->comment('网规等级');
            $table->unsignedTinyInteger('settle')->default(0)->comment('入驻状态');
            $table->unsignedTinyInteger('collect')->default(0)->comment('是否收藏');
            $table->string('prefixAddress', 15)->default('')->comment('省市区');
            $table->string('address', 120)->default('')->comment('省市区');
            $table->unsignedInteger('provinceCode')->default(0)->comment('省');
            $table->unsignedInteger('cityCode')->default(0)->comment('市');
            $table->unsignedInteger('districtCode')->default(0)->comment('区');
            $table->unsignedInteger('followUpTime')->default(0)->comment('最新跟进时间');
            $table->unsignedInteger('preHaving')->default(0)->comment('预计出铺时间');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '大客户部任务表';

            $table->index('wgNumber', 'idx_wgNumber');
            $table->index('assignId', 'idx_assignId');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('customer_department_task');
    }
}
